package com.empty.oredermenu.base

import android.app.Activity
import android.os.Bundle
import android.widget.ImageView
import android.widget.TextView
import com.empty.oredermenu.R
import com.empty.oredermenu.utils.ToolsUtils
import com.empty.oredermenu.utils.TypefaceUtil
import kotlinx.android.synthetic.main.layout_activity_title.*
import uk.co.chrisjenx.calligraphy.CalligraphyConfig
import java.text.SimpleDateFormat

/**
 * Created by empty on 2017/7/10.
 * 所有界面的管理
 */

open class OrderMenuBaseActivity : Activity() {
    var ft = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")

    var layout_title:TextView? = null
    var image_back :ImageView? = null

    var toolsUtils : ToolsUtils? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        toolsUtils = ToolsUtils()
        //改变字体
//        CalligraphyConfig.initDefault(CalligraphyConfig.Builder()
//                .setDefaultFontPath("fonts/Roboto-Bold.ttf")
//                .setFontAttrId(R.attr.fontPath)
//                .build()
//        )
//        TypefaceUtil.replaceFont(this, "fonts/gtw.ttf")
    }

    fun baseInitView(){
        image_back = findViewById(R.id.image_back) as ImageView
        image_back!!.setOnClickListener {
            finish()
        }

        layout_title = findViewById(R.id.layout_title) as TextView

    }

}
